#ifndef WEBSOCKETBROADCASTER_H_
#define WEBSOCKETBROADCASTER_H_

#include <pthread.h>
#include "WebSocketConnection.h"

class WebSocketBroadcaster {
public:
	WebSocketBroadcaster();
	virtual ~WebSocketBroadcaster();
	void addConnection(WebSocketConnection* conn);
	void removeConnection(WebSocketConnection* conn);

protected:
	void broadcast(string message);

private:
	WebSocketConnection** connList;
	int connCount;
	pthread_rwlock_t connListLock;
};

#endif /* WEBSOCKETBROADCASTER_H_ */
